// hyb_yl/czhuanjiasubpages/pages/longsever/index.js
var app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    xieyi: false
  },
  xieyibtn: function () {
    this.setData({
      xieyi: true
    })
  },
  closezhe: function () {
    this.setData({
      xieyi: false
    })
  },
  nextpage: function () {
    var that = this
    var ser_key = that.data.ser_key
    var tit = that.data.tit
    wx.navigateTo({
      url: '/hyb_yl/userLife/pages/faxian/faxian?tit=' + tit + '&pinyin=' + ser_key
    })
  },

  urlpage1: function () {
    var that = this
    var ser_key = that.data.ser_key
    wx.navigateTo({
      url: '/hyb_yl/czhuanjiasubpages/pages/estimate/estimate?key='+this.data.ser_key
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this
    var tit = options.tit
    var ser_key = options.ser_key
    var bgc = wx.getStorageSync('color')
    var id = options.id
    wx.setNavigationBarTitle({
      title: tit
    })
    wx.setNavigationBarColor({
      frontColor: "#ffffff",
      backgroundColor: bgc,
    })
    that.setData({
      bgc: bgc,
      tit: tit,
      ser_key: ser_key,
      id: id
    })

    app.util.request({
      'url': 'entry/wxapp/index.detailserones',
      data: {
        ser_key: ser_key,
        id: id
      },
      success: function (res) {
        console.log(res, '222222222222222222')
        that.setData({
          detail: res.data
        })
      },
      fail: function (err) {
        console.log(err)
      },
    })
    
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  },
  getDetailser() {
    var that = this
    var ser_key = that.data.ser_key

  }
})